//
//  CYSearchProjectTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/2/1.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYSearchProjectTableViewCell.h"

@implementation CYSearchProjectTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    
    NSUserDefaults *us = [NSUserDefaults standardUserDefaults];
    NSString * str = [us objectForKey:@"searchValue"];
    
    
    self.titleLabel.attributedText = [NSMutableAttributedString stringWithHighLightSubstring:model.item_title substring:str];
    self.introLabel.attributedText = [NSMutableAttributedString stringWithHighLightSubstring:model.content substring:str];;

    self.bottomLabel.text = [NSString stringWithFormat:@"%@ - %@ - %@ > %@ - %@", model.brand, model.address, model.big_catname, model.catname, model.company_name];

    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.logo_item] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
